home *** CD-ROM | disk | FTP | other *** search
/ Wayzata's Best of Shareware PC/Windows 2 / Wayzata's Best of Shareware 2.0 (Windows) (Wayzata Technology)(7112)(1994).bin / pc / dos / programg / decgif3 / usedgif.bas < prev    next >
BASIC Source File  |  1992-08-01  |  2KB  |  73 lines

  1. '*****************************************************************************
  2. '* This program demonstrates how to use the GIF decompression subroutine.
  3. '* It must be compiled for maximum speed!
  4. '* By Rich Geldreich 1992
  5. '*
  6. '* Any bugs/problems, write or call:
  7. '*
  8. '* Rich Geldreich
  9. '* 410 Market St.
  10. '* Gloucester City, NJ 08030
  11. '* (609)-456-8752
  12. DEFINT A-Z
  13.  
  14. DECLARE SUB X360x480 ()
  15. DECLARE FUNCTION LoadGIF (F$, Vm, ShowType, Xorigin, Yorigin, XScale, YScale)
  16.  
  17. DIM R(255), G(255), B(255)
  18.  
  19. 'mode 0=320x200x256 vga
  20. 'mode 1=360x480x256 vga
  21. 'mode 2=640x480x16  vga
  22. 'mode 3=320x200x16  ega
  23. 'mode 4=640x350x16  ega
  24.  
  25. DO
  26.   
  27.     SCREEN 0: WIDTH 80: CLS
  28.     PRINT "QuickBASIC 4.5 GIF Decompressor"
  29.     PRINT "By Rich Geldreich 1992"
  30.     PRINT : LINE INPUT "Filename? "; A$
  31.     A$ = LTRIM$(RTRIM$(A$))
  32.     IF A$ = "" THEN CLS : END
  33.     PRINT "Modes:"
  34.     PRINT "1. 320x200x256 VGA"
  35.     PRINT "2. 360x480x256 VGA"
  36.     PRINT "3. 640x480x16  VGA"
  37.     PRINT "4. 320x200x16  EGA"
  38.     PRINT "5. 640x350x16  EGA"
  39.     DO
  40.         LINE INPUT "Graphics mode? "; B$:
  41.         Mode = VAL(B$)
  42.     LOOP WHILE Mode < 1 AND Mode > 5
  43.  
  44.     INPUT "X Scale(-1 for autofit)"; XScale: IF XScale = 0 THEN XScale = 256
  45.     INPUT "Y Scale(-1 for autofit)"; YScale: IF YScale = 0 THEN YScale = 256
  46.     INPUT "X origin"; Xorigin
  47.     INPUT "Y origin"; Yorigin
  48.    
  49.     SELECT CASE Mode
  50.         CASE 1
  51.             SCREEN 13
  52.         CASE 2
  53.             SCREEN 13 '<-- this is only here so QB switces back to text
  54.                       '    mode when everthing is done
  55.             X360x480
  56.         CASE 3
  57.             SCREEN 12
  58.         CASE 4
  59.             SCREEN 7
  60.         CASE 5
  61.             SCREEN 9
  62.     END SELECT
  63.     ErrorCode = LoadGIF(A$, Mode - 1, 0, Xorigin, Yorigin, XScale, YScale)
  64.     IF ErrorCode THEN
  65.         SCREEN 0: WIDTH 80: PRINT "Error:"; ErrorCode
  66.     END IF
  67.     BEEP
  68.     A$ = INPUT$(1)
  69. LOOP
  70. END
  71.  
  72.  
  73.